Page({
  data: {
    banners: [
      { id: 1, image: 'https://dummyimage.com/1200x600/eeeeee/aaaaaa.png&text=banner' },
      { id: 2, image: 'https://dummyimage.com/1200x600/eeeeee/aaaaaa.png&text=banner' }
    ],
    activities: [
      {
        id: 1,
        title: '太极拳晨练',
        time: '06:00-07:00',
        location: '社区广场',
        participants: 28,
        joined: false,
        image: 'https://dummyimage.com/800x600/eeeeee/aaaaaa.png&text=activity'
      },
      {
        id: 2,
        title: '健康讲座',
        time: '14:00-16:00',
        location: '活动中心',
        participants: 45,
        joined: true,
        image: 'https://dummyimage.com/800x600/eeeeee/aaaaaa.png&text=activity'
      }
    ]
  },

  onActivityTap(e) {
    const id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: `/pages/community/activity/activity?id=${id}`
    });
  }
})
